<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>confirm，</title>
    <style>
        input{
            width:200px;
            height:50px;
            background-color: green;
        }
    </style>
</head>
<body>
<input type="button" value="注册" id="btn"/>
<script>
    var oBtn=document.getElementById("btn");
    oBtn.onclick=function(){
        var s=prompt("请输入邮箱：");
        var xhr=new XMLHttpRequest();
        xhr.open("post","confirm.html",true);
        xhr.send(s);
        xhr.onreadystatechange=function(res){
            if(xhr.readyState===4&&xhr.status===200){
                alert("success");
            }
        }
    }
</script>
</body>
</html>